package com.efamily.ewallet.client.utils;

import com.efamily.ewallet.client.exception.DayConvertException;
import com.efamily.ewallet.client.exception.MonthConvertException;

public class Utils {
	private final static String[] dayName = { "Sunday", "Monday", "Tuesday",
			"Wednesday", "Thursday", "Friday", "Saturday" };
	private final static String[] monthName = { "January", "February", "March",
			"April", "May", "June", "July", "August", "September", "October",
			"November", "December" };

	public static String intToDayName(final int i) throws DayConvertException {
		try {
			return dayName[i];
		} catch (ArrayIndexOutOfBoundsException exc) {
			throw new DayConvertException(
					"You can use number in range between 0 and 6. Inputed number was "
							+ i);
		}
	}

	public static String intToMonthName(final int i)
			throws MonthConvertException {
		try {
			return monthName[i];
		} catch (ArrayIndexOutOfBoundsException exc) {
			throw new MonthConvertException(
					"You can use number in range between 0 and 11. Inputed number was "
							+ i);
		}
	}

}
